package com.zzl.bonds.ticket.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.zzl.bonds.ticket.dto.TicketFlowChartDto;
import com.zzl.bonds.ticket.entity.TicketFlowChartEntity;
import com.zzl.general.common.exception.SysException;
import com.zzl.general.common.serurity.entity.User;

import java.util.List;

/**
 * 流程图表
 *
 * @author sunpp
 * @date 2022-02-16 11:14:07
 */
@SuppressWarnings("javadoc")
public interface TicketFlowChartService extends IService<TicketFlowChartEntity> {
    /**
     * 我的票据详情票据流转图
     * @param ticketId
     * @return
     * @throws SysException
     */
    List<TicketFlowChartDto> ticketFlowChart(String ticketId) throws SysException;

    /**
     * 根据票据id获取最近的id
     *
     * @param ticketId
     * @return
     */
    TicketFlowChartEntity getLastIdForTicketId(String ticketId);

    void saveTicketFlowChartEntity(List<TicketFlowChartEntity> ticketFlowChartEntitys, User user) throws SysException;

    TicketFlowChartEntity getOneByTicketId(String ticketId);

    /*
       获取开立申请的票据流程
     */
    List<TicketFlowChartEntity> listByTicketOpenId(String ticketOpenId);

    List<TicketFlowChartEntity> listByTicketIds(List<String> ticketIds);

    /**
     * 转让申请详情票据流转图
     * @param transferId
     * @return
     * @throws SysException
     */
    List<TicketFlowChartDto>  transferFlowChart(String transferId)throws SysException;

    /**
     * 开立签收详情票据流转图
     * @param ticketOpenId
     * @return
     * @throws SysException
     */
    List<TicketFlowChartDto>  openSign(String ticketOpenId)throws SysException;

    /**
     * 开立详情票据流转图总的
     * @param ticketOpenId
     * @return
     * @throws SysException
     */
    List<TicketFlowChartDto>  openSignAll(String ticketOpenId)throws SysException;

    /**
     * 查询开单的票据轨迹
     * @param ticketOpenId 开立id
     * @return 流转轨迹
     */
    TicketFlowChartEntity getOneByOpenTicketId(String ticketOpenId);
}

